home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / FOYEH201.ZIP / FOYEH1.PAS < prev    next >
Pascal/Delphi Source File  |  1993-10-04  |  9KB  |  240 lines

  1. {*** TURBO PASCAL UNIT: INTERFACE TO FOYEH1.DLL                 **}
  2. {*** Released into the public domain by Dr. A. Olowofoyeku      **}
  3.  
  4. {*** If anyone can convert this into a C/C++ HEADER file        **}
  5. {*** please do so, and please send me a copy of the header      **}
  6. {*** file.                                                      **}
  7.  
  8. {*** Documentation for the routines in the DLL is supplied in   **}
  9. {*** the file FOYEH1.INT                                        **}
  10.  
  11. {*** The Dynamic Link Library FOYEH1.DLL is supplied with       **}
  12. {*** many of my Windows and Win-OS/2 programs. I am constantly  **}
  13. {*** developing and updating it. If you have any problems or    **}
  14. {*** discover any bugs while using it with your own programs    **}
  15. {*** please mail me, and I will try and fix it. NOTE: however   **}
  16. {*** that I do not make any warranties concerning my FOYEH1.DLL **}
  17. {*** or this interface UNIT to it. Everybody uses both of them  **}
  18. {*** at their own risk. The DLL itself is already widely        **}
  19. {*** available. I am only releasing the interface to it, so     **}
  20. {*** that others may benefit from some of its routines.         **}
  21.  
  22. {*** NOTE: that some of the routines in the DLL require the     **}
  23. {*** presence of Borland's BWCC.DLL. If you are a TPW/BP7 user  **}
  24. {*** you already have this DLL. However, most of the routines   **}
  25. {*** do not require BWCC.DLL. You can normally tell from the    **}
  26. {*** name of the routine whether it uses any call from BWCC.DLL **}
  27.  
  28. {*** Note also, that if you have an old version of FOYEH1.DLL   **}
  29. {*** then some of the routines may not be available.            **}
  30.  
  31. {*** ALL THE FOUR FILES (i.e., FOYEH1.DLL, FOYEH1.PAS,          **}
  32. {*** FOYEH1.INT, and FOYEH1.SUM) MUST BE INCLUDED IN ANY        **}
  33. {*** DISTRIBUTION.                                              **}
  34.  
  35.  
  36.  
  37. {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
  38. { Dr. A. Olowofoyeku                                  }
  39. { 268 Horwood                                         }
  40. { Newcastle                                           }
  41. { Staffs ST5 5BQ,                                     }
  42. { England.                                            }
  43. {                                                     }
  44. {  E-mail:laa12@seq1.keele.ac.uk                      }
  45. {                                                     }
  46. { October 1993.                                       }
  47. {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
  48.  
  49. UNIT Foyeh1;
  50. {*** This unit has 40 routines  **}
  51.  
  52. INTERFACE
  53. {$F+,G+}
  54.  
  55. USES
  56. Wintypes;
  57.  
  58. Type
  59.      String79    = String[79];
  60.      StringArray = Array[1..20] of String79;
  61.  
  62. {-----------------------------------------------------------------------}
  63. Function   DllVersion : Word;
  64. Function   GetS(Prompt : String) : String;
  65. Function   ShowDir : String79;
  66. Procedure  ErrorMessage(Caption, Msg : PChar);
  67. Procedure  BWCCErrorMessage(Caption, Msg : PChar; Extra : Word);
  68. Procedure  ModalMessageBox(Caption, Msg : PChar);
  69. Function   Confirm(Caption, Msg : PChar) : Boolean;
  70. Function   BwccConfirm(Caption, Msg : PChar) : Boolean;
  71. Function   ConfirmModal(Caption,Msg : PChar) : Boolean;
  72. Function   ExistOnPath(FName : String79; Var Dest : String79) : Boolean;
  73. Function   Exist(Var Fname : String79) : Boolean;
  74. Function   FSize(FName : String79) : LongInt;
  75. Function   HasWildCards(s : String) : Boolean;
  76. Function   IsDirectory(var MyDir : string79): Boolean;
  77. Function   IsCommand(Command : String79) : String79;
  78. Function   GetDriver : String79;
  79. Procedure  Wait;
  80. Procedure  Pause;
  81. Function   DeleteFile(FName : String) : Boolean;
  82. Function   CopyFile(Source, Dest : String79) : Boolean;
  83. Function   StUpcase(S : String) : String;
  84. function   Getlabel(drive : char) : string79;
  85. Function   LabelDrive(Drive, NewLabel : string79) : Boolean;
  86. Function   PlaySoundFile(sFile : String) : Boolean;
  87. Function   FileOpen(Wnd : HWnd; Caption, DefExt : String) : String79;
  88. Function   GetFileName(Wind : HWND; Caption, Mask : String79) : String79;
  89. Function   GetIniEntry(Title, INIfile : String79) : String79;
  90. Function   SystemDirectory : String;
  91. Function   WindowsDirectory : String;
  92. Function   SaveWinDesktop(FName : String) : Boolean;
  93. Function   RestoreWinDesktop(FName : String) : Boolean;
  94. Function   Str2Byte(S : string; var B : Byte) : Boolean;
  95. Function   Str2Int(S : string; var I : Integer) : Boolean;
  96. Function   Str2Word(S : string; var W : Word) : Boolean;
  97. Function   Str2Long(S : string; var L : LongInt) : Boolean;
  98. Function   Str2Real(S : string; var R : Real) : Boolean;
  99. Function   Trim(S : string) : string;
  100. Function   AddBackSlash(DirName : String79) : String79;
  101. Function   ConcatFiles (Var First, Second, Dest : String79)
  102.            : Boolean;
  103.  
  104. Function   SplitString (Var Source : String; Var StArray : StringArray)
  105.            : Byte;
  106.  
  107.  
  108.  
  109. (***********************************************************************)
  110. (***********************************************************************)
  111. (******* END OF INTERFACE SECTION    ***********************************)
  112. (***********************************************************************)
  113.  
  114. IMPLEMENTATION
  115.  
  116. {-----------------------------------------------------}
  117. Function DllVersion : Word;  {* this DLL version *}
  118.          External 'FOYEH1' index 200;
  119.  
  120. Function  GetS(Prompt : String) : String;
  121.           External 'FOYEH1' index 1;
  122.  
  123. Function  ShowDir : String79;
  124.           External 'FOYEH1' index 2;
  125.  
  126. Procedure ErrorMessage(Caption,Msg : PChar);
  127.           External 'FOYEH1' index 4;
  128.  
  129. Function  Confirm(Caption,Msg : PChar) : Boolean;
  130.           External 'FOYEH1' index 5;
  131.  
  132. Function  ExistOnPath(FName : String79; Var Dest : String79) : Boolean;
  133.           External 'FOYEH1' index 6;
  134.  
  135. Function  Exist(Var Fname : String79) : Boolean;
  136.           External 'FOYEH1' index 7;
  137.  
  138. Function  FSize(FName : String79) : LongInt;
  139.           External 'FOYEH1' index 8;
  140.  
  141. Function  HasWildCards(s : String) : Boolean;
  142.           External 'FOYEH1' index 9;
  143.  
  144. Function  IsDirectory(var MyDir : string79): Boolean;
  145.           External 'FOYEH1' index 10;
  146.  
  147. Function  IsCommand(Command : String79) : String79;
  148.           External 'FOYEH1' index 11;
  149.  
  150. Function  GetDriver : String79;
  151.           External 'FOYEH1' index 12;
  152.  
  153. Procedure Wait;
  154.           External 'FOYEH1' index 13;
  155.  
  156. function  Str2Byte(S : string; var B : Byte) : Boolean;
  157.           External 'FOYEH1' index 14;
  158.  
  159. function  Str2Int(S : string; var I : Integer) : Boolean;
  160.           External 'FOYEH1' index 15;
  161.  
  162. function  Str2Word(S : string; var W : Word) : Boolean;
  163.           External 'FOYEH1' index 16;
  164.  
  165. function  Str2Long(S : string; var L : LongInt) : Boolean;
  166.           External 'FOYEH1' index 17;
  167.  
  168. function  Str2Real(S : string; var R : Real) : Boolean;
  169.           External 'FOYEH1' index 18;
  170.  
  171. function  Trim(S : string) : string;
  172.           External 'FOYEH1' index 21;
  173.  
  174. function  AddBackSlash(DirName : String79) : String79;
  175.           External 'FOYEH1' index 26;
  176.  
  177. Function  CopyFile(Source, Dest : String79) : Boolean;
  178.           External 'FOYEH1' index 29;
  179.  
  180. Function  DeleteFile(FName : String) : Boolean;
  181.           External 'FOYEH1' index 30;
  182.  
  183. Function  StUpcase(S : String) : String;
  184.           External 'FOYEH1' index 31;
  185.  
  186. function  getlabel(drive : char) : string79;
  187.           External 'FOYEH1' index 32;
  188.  
  189. Function  LabelDrive(Drive, NewLabel : string79) : Boolean;
  190.           External 'FOYEH1' index 33;
  191.  
  192. Function  PlaySoundFile(sFile : String) : Boolean;
  193.           External 'FOYEH1' index 34;
  194.  
  195. Function  ConfirmModal(Caption,Msg : PChar) : Boolean;
  196.           External 'FOYEH1' index 35;
  197.  
  198. Procedure ModalMessageBox(Caption,Msg : PChar);
  199.           External 'FOYEH1' index 36;
  200.  
  201. Procedure BWCCErrorMessage(Caption,Msg : PChar; Extra : Word);
  202.           External 'FOYEH1' index 37;
  203.  
  204. Procedure Pause;
  205.           External 'FOYEH1' index 38;
  206.  
  207. Function  Fileopen(Wnd : HWnd; Caption, DefExt : String) : String79;
  208.           External 'FOYEH1' index 39;
  209.  
  210. Function  GetFileName(Wind : HWND; Caption, Mask : String79) : String79;
  211.           External 'FOYEH1' index 41;
  212.  
  213. F